package com.ld.vaadin.view;

import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.auth.AnonymousAllowed;

@Route("")
@AnonymousAllowed
public class LoginView extends VerticalLayout {

    public LoginView() {

//        路由跳转-有可能不加载样式，需要再次刷新页面才行
//        UI.getCurrent().navigate(IndexView.class);
//        路由跳转-无上边的bug
//        getUI().ifPresent(ui -> ui.navigate("/"));

//        重定向
        UI.getCurrent().getPage().setLocation("login");
    }
}
